﻿namespace KingerRobot.MexicoSailunMDC.SpiService;

internal interface IWcsAsrsCrnInput
{
    /// <summary>
    /// 查找所有
    /// </summary>
    /// <returns></returns>
    List<POWcsAsrsCrnInput> GetWcsAsrsCrnInputs();

    List<long> GetWcsAsrsCrnInputsByLocIds(List<long?> locIds);

    /// <summary>
    /// 通过堆垛机获取所有入库站台未
    /// </summary>
    /// <param name="crnId"></param>
    /// <returns></returns>
    POWcsAsrsCrnInput GetWcsAsrsCrnInputsByEquipId(long crnId);
    /// <summary>
    /// 通过多个堆垛机获取所有入库站台未
    /// </summary>
    /// <param name="crnIds"></param>
    /// <returns></returns>
    List<POWcsAsrsCrnInput> GetWcsAsrsCrnInputsByEquipIds(List<long?> crnIds);
    /// <summary>
    /// 通过一个放货位获取堆垛机
    /// </summary>
    /// <param name="loc"></param>
    /// <returns></returns>
    POWcsAsrsCrnInput GetWcsAsrsCrnInputByLoc(long loc);

    /// <summary>
    /// 通过两个放货位获取堆垛机
    /// </summary>
    /// <param name="loc1"></param>
    /// <param name="loc2"></param>
    /// <returns></returns>
    POWcsAsrsCrnInput GetWcsAsrsCrnInputByLoc(long loc1, long loc2);
    /// <summary>
    /// 两个放货位 是否配对
    /// </summary>
    /// <param name="loc1"></param>
    /// <param name="loc2"></param>
    /// <returns></returns>
    bool HasWcsAsrsCrnInputByLoc(long loc1, long loc2);
    /// <summary>
    /// 通过放货位获取 货叉
    /// </summary>
    /// <param name="loc"></param>
    /// <returns></returns>
    CrnForkBean GetForkByLoc(long loc);

    /// <summary>
    /// 货叉和堆垛机是否可用(true 有；false 无)
    /// </summary>
    /// <param name="loc"></param>
    /// <returns></returns>
    bool IsEnableEquip(long loc);

    /// <summary>
    /// 获取所有有货的站台位
    /// </summary>
    /// <param name="crnIds"></param>
    /// <returns></returns>
    List<HasSkuLoc> GetHasSkuLoc(List<long?> crnIds);

    /// <summary>
    /// 通过堆垛机id修改未入库原因
    /// </summary>
    /// <param name="crnId">堆垛机id</param>
    /// <param name="remark">入库未生成入库任务原因 内容+[时间]</param>
    /// <returns></returns>
    int UpdateRemarkByCrnId(long crnId, string remark);
}

internal class CrnForkBean
{
    public long? CrnId { get; set; }
    public long ForkId { get; set; }
}